<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript" src="js/simpleInheritance.js"></script>
	<script type="text/javascript">
		//创建类
		var People = Class.extend({
			init : function(name,age,sex){
				this.name = name;
				this.age = age;
				this.sex = sex;
			},
			say : function(){
				alert("你好，我是" + this.name + "今年" + this.age + "岁了" + "我是个" + this.sex + "生");
			},
			zhangyisui : function(){
				this.age ++;
			}
		});

		//子类
		var Student = People.extend({
			init : function(name,age,sex,xuehao){
				//运行一次父类的init
				this._super(name,age,sex);
				this.xuehao = xuehao;
			},
			say : function(){
				//运行一次父类的say方法
				this._super();
				alert(this.xuehao);
			},
			study : function(){
				alert("我开始学习");
			}
		});
		 
		var chenwei = new Student("陈伟",12,"男",123456);
		chenwei.say();
		chenwei.study();
	</script>
</body>
</html>